package xarray

func Contains(array []string, value string) bool {
	for _, v := range array {
		if v == value {
			return true
		}
	}
	return false
}
func ContainsInt(array []int, value int) bool {
	for _, v := range array {
		if v == value {
			return true
		}
	}
	return false
}
func ContainsInt64(array []int64, value int64) bool {
	for _, v := range array {
		if v == value {
			return true
		}
	}
	return false
}

// Insert 插入数据到数组的指定位置
func Insert[T any](array []T, index int, value T) []T {
	return append(array[:index], append([]T{value}, array[index:]...)...)
}
